#pragma once
#include "MasterClass.h"
#include "Archivo.h"
namespace BuildTimeUserInterface {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	/// <summary>
	/// Summary for FormHorario
	/// </summary>
	public ref class FormHorario : public System::Windows::Forms::Form
	{
	public:
		MasterClass *objMasterClass;
	public:
		FormHorario(void)
		{
			InitializeComponent();
			//
			//TODO: Add the constructor code here
			//
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~FormHorario()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::Button^  btnGenerar;
	protected: 

	protected: 
	private: System::Windows::Forms::TextBox^  txtURL;
	private: System::Windows::Forms::Label^  lblDireccion;
	private: System::Windows::Forms::Button^  btnExplorar;
	private: System::Windows::Forms::FolderBrowserDialog^  fdDirectorio;

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(FormHorario::typeid));
			this->btnGenerar = (gcnew System::Windows::Forms::Button());
			this->txtURL = (gcnew System::Windows::Forms::TextBox());
			this->lblDireccion = (gcnew System::Windows::Forms::Label());
			this->btnExplorar = (gcnew System::Windows::Forms::Button());
			this->fdDirectorio = (gcnew System::Windows::Forms::FolderBrowserDialog());
			this->SuspendLayout();
			// 
			// btnGenerar
			// 
			this->btnGenerar->BackColor = System::Drawing::Color::White;
			this->btnGenerar->BackgroundImage = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"btnGenerar.BackgroundImage")));
			this->btnGenerar->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Stretch;
			this->btnGenerar->Location = System::Drawing::Point(528, 12);
			this->btnGenerar->Name = L"btnGenerar";
			this->btnGenerar->Size = System::Drawing::Size(58, 58);
			this->btnGenerar->TabIndex = 15;
			this->btnGenerar->UseVisualStyleBackColor = false;
			this->btnGenerar->Click += gcnew System::EventHandler(this, &FormHorario::btnGenerar_Click);
			// 
			// txtURL
			// 
			this->txtURL->Location = System::Drawing::Point(96, 25);
			this->txtURL->Name = L"txtURL";
			this->txtURL->ReadOnly = true;
			this->txtURL->Size = System::Drawing::Size(362, 23);
			this->txtURL->TabIndex = 14;
			// 
			// lblDireccion
			// 
			this->lblDireccion->AutoSize = true;
			this->lblDireccion->Location = System::Drawing::Point(12, 28);
			this->lblDireccion->Name = L"lblDireccion";
			this->lblDireccion->Size = System::Drawing::Size(66, 15);
			this->lblDireccion->TabIndex = 13;
			this->lblDireccion->Text = L"Directorio:";
			// 
			// btnExplorar
			// 
			this->btnExplorar->BackColor = System::Drawing::Color::White;
			this->btnExplorar->BackgroundImage = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"btnExplorar.BackgroundImage")));
			this->btnExplorar->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Stretch;
			this->btnExplorar->Location = System::Drawing::Point(464, 13);
			this->btnExplorar->Name = L"btnExplorar";
			this->btnExplorar->Size = System::Drawing::Size(58, 58);
			this->btnExplorar->TabIndex = 12;
			this->btnExplorar->UseVisualStyleBackColor = false;
			this->btnExplorar->Click += gcnew System::EventHandler(this, &FormHorario::btnExplorar_Click);
			// 
			// FormHorario
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(7, 15);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->BackColor = System::Drawing::Color::AliceBlue;
			this->ClientSize = System::Drawing::Size(601, 83);
			this->Controls->Add(this->btnGenerar);
			this->Controls->Add(this->txtURL);
			this->Controls->Add(this->lblDireccion);
			this->Controls->Add(this->btnExplorar);
			this->Font = (gcnew System::Drawing::Font(L"Calibri", 9.75F, System::Drawing::FontStyle::Bold));
			this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::Fixed3D;
			this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
			this->MaximizeBox = false;
			this->MinimizeBox = false;
			this->Name = L"FormHorario";
			this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
			this->Text = L"Build Time - Horarios";
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion
	private: System::Void btnExplorar_Click(System::Object^  sender, System::EventArgs^  e) 
			 {
				 fdDirectorio->ShowDialog();
				 txtURL->Text=fdDirectorio->SelectedPath;
			 }
private: System::Void btnGenerar_Click(System::Object^  sender, System::EventArgs^  e) 
		 {
			 //objMasterClass->Solucion();
			 Archivo *objArchivo= new Archivo();
			char *Directorio=(char*)System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(txtURL->Text).ToPointer();
			objArchivo->ArchivoCrear(objMasterClass,Directorio);
		 }
};
}
